const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
-function PowerMenuButton() {
- this._init();
-}
-
-PowerMenuButton.prototype = {
- __proto__: PanelMenu.SystemStatusButton.prototype,
+const PowerMenuButton = new Lang.Class({
+ Name: 'PowerMenuButton',
+ Extends: PanelMenu.SystemStatusButton,
_init: function() {
- PanelMenu.SystemStatusButton.prototype._init.call(this, 'system-shutdown', null);
+ this.parent('system-shutdown', null);
this._consoleKitManager = new ConsoleKit.ConsoleKitManager();
this._upClient = new UPowerGlib.Client();
if (this._haveShutdown)
this._consoleKitManager.StopRemote();
}
-};
+});
cr.stroke();
};
-function DateMenuButton() {
- this._init.apply(this, arguments);
-}
-
-DateMenuButton.prototype = {
- __proto__: PanelMenu.Button.prototype,
+const DateMenuButton = new Lang.Class({
+ Name: 'DateMenuButton',
+ Extends: PanelMenu.Button,
_init: function(params) {
params = Params.parse(params, { showEvents: true });
let menuAlignment = 0.25;
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
menuAlignment = 1.0 - menuAlignment;
- PanelMenu.Button.prototype._init.call(this, menuAlignment);
+ this.parent(menuAlignment);
this._clock = new St.Label();
this.actor.add_actor(this._clock);
}
}
}
-};
+});
* this menu also handles startup notification for it. So when we
* have an active startup notification, we switch modes to display that.
*/
-function AppMenuButton() {
- this._init();
-}
-
-AppMenuButton.prototype = {
- __proto__: PanelMenu.Button.prototype,
+const AppMenuButton = new Lang.Class({
+ Name: 'AppMenuButton',
+ Extends: PanelMenu.Button,
_init: function() {
- PanelMenu.Button.prototype._init.call(this, 0.0);
+ this.parent(0.0);
this._startingApps = [];
this._targetApp = null;
this.emit('changed');
}
-};
+});
Signals.addSignalMethods(AppMenuButton.prototype);
// Activities button. Because everything else in the top bar is a
// PanelMenu.Button, it simplifies some things to make this be one too.
// We just hack it up to not actually have a menu attached to it.
-function ActivitiesButton() {
- this._init.apply(this, arguments);
-}
-
-ActivitiesButton.prototype = {
- __proto__: PanelMenu.Button.prototype,
+const ActivitiesButton = new Lang.Class({
+ Name: 'ActivitiesButton',
+ Extends: PanelMenu.Button,
_init: function() {
- PanelMenu.Button.prototype._init.call(this, 0.0);
+ this.parent(0.0);
let container = new Shell.GenericContainer();
container.connect('get-preferred-width', Lang.bind(this, this._containerGetPreferredWidth));
Mainloop.source_remove(this._xdndTimeOut);
this._xdndTimeOut = 0;
}
-};
+})
function PanelCorner(panel, side) {
this._init(panel, side);
const Params = imports.misc.params;
const PopupMenu = imports.ui.popupMenu;
-function ButtonBox(params) {
- this._init.apply(this, arguments);
-};
+const ButtonBox = new Lang.Class({
+ Name: 'ButtonBox',
-ButtonBox.prototype = {
_init: function(params) {
params = Params.parse(params, { style_class: 'panel-button' }, true);
this.actor = new Shell.GenericContainer(params);
child.allocate(childBox, flags);
},
-}
+});
-function Button(menuAlignment) {
- this._init(menuAlignment);
-}
-
-Button.prototype = {
- __proto__: ButtonBox.prototype,
+const Button = new Lang.Class({
+ Name: 'PanelMenuButton',
+ Extends: ButtonBox,
_init: function(menuAlignment) {
- ButtonBox.prototype._init.call(this, { reactive: true,
- can_focus: true,
- track_hover: true });
+ this.parent({ reactive: true,
+ can_focus: true,
+ track_hover: true });
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
this.actor.connect('key-press-event', Lang.bind(this, this._onSourceKeyPress));
this.emit('destroy');
}
-};
+});
Signals.addSignalMethods(Button.prototype);
/* SystemStatusButton:
* volume, bluetooth...), which is just a PanelMenuButton with an
* icon and a tooltip
*/
-function SystemStatusButton() {
- this._init.apply(this, arguments);
-}
-
-SystemStatusButton.prototype = {
- __proto__: Button.prototype,
+const SystemStatusButton = new Lang.Class({
+ Name: 'SystemStatusButton',
+ Extends: Button,
_init: function(iconName,tooltipText) {
- Button.prototype._init.call(this, 0.0);
+ this.parent(0.0);
+
this._iconActor = new St.Icon({ icon_name: iconName,
icon_type: St.IconType.SYMBOLIC,
style_class: 'system-status-icon' });
this.tooltip = null;
}
}
-};
+});
const HIGH_CONTRAST_THEME = 'HighContrast';
-function ATIndicator() {
- this._init.apply(this, arguments);
-}
-
-ATIndicator.prototype = {
- __proto__: PanelMenu.SystemStatusButton.prototype,
+const ATIndicator = new Lang.Class({
+ Name: 'ATIndicator',
+ Extends: PanelMenu.SystemStatusButton,
_init: function() {
- PanelMenu.SystemStatusButton.prototype._init.call(this, 'preferences-desktop-accessibility', null);
+ this.parent('preferences-desktop-accessibility', null);
let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast);
});
return widget;
}
-};
-Signals.addSignalMethods(ATIndicator.prototype);
+});
CONNECTING: 3
}
-function Indicator() {
- this._init.apply(this, arguments);
-}
-
-Indicator.prototype = {
- __proto__: PanelMenu.SystemStatusButton.prototype,
+const Indicator = new Lang.Class({
+ Name: 'BTIndicator',
+ Extends: PanelMenu.SystemStatusButton,
_init: function() {
- PanelMenu.SystemStatusButton.prototype._init.call(this, 'bluetooth-disabled', null);
+ this.parent('bluetooth-disabled', null);
GLib.spawn_command_line_sync ('pkill -f "^bluetooth-applet$"');
this._applet = new GnomeBluetoothApplet.Applet();
_cancelRequest: function() {
this._source.destroy();
}
-}
+});
function Source() {
this._init.apply(this, arguments);
}
});
-function XKBIndicator() {
- this._init.call(this);
-}
-
-XKBIndicator.prototype = {
- __proto__: PanelMenu.Button.prototype,
+const XKBIndicator = new Lang.Class({
+ Name: 'XKBIndicator',
+ Extends: PanelMenu.Button,
_init: function() {
- PanelMenu.Button.prototype._init.call(this, St.Align.START);
+ this.parent(0.0);
this._container = new Shell.GenericContainer();
this._container.connect('get-preferred-width', Lang.bind(this, this._containerGetPreferredWidth));
for (let i = 0; i < this._labelActors.length; i++)
this._labelActors[i].allocate_align_fill(box, 0.5, 0, false, false, flags);
}
-};
+});
},
};
-function NMApplet() {
- this._init.apply(this, arguments);
-}
-NMApplet.prototype = {
- __proto__: PanelMenu.SystemStatusButton.prototype,
+const NMApplet = new Lang.Class({
+ Name: 'NMApplet',
+ Extends: PanelMenu.SystemStatusButton,
_init: function() {
- PanelMenu.SystemStatusButton.prototype._init.call(this, 'network-error');
+ this.parent('network-error', null);
this._client = NMClient.Client.new();
this._mobileUpdateId = 0;
}
}
-};
+});
function NMMessageTraySource() {
this._init();
const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(PowerManagerInterface);
-function Indicator() {
- this._init.apply(this, arguments);
-}
-
-Indicator.prototype = {
- __proto__: PanelMenu.SystemStatusButton.prototype,
+const Indicator = new Lang.Class({
+ Name: 'PowerIndicator',
+ Extends: PanelMenu.SystemStatusButton,
_init: function() {
- PanelMenu.SystemStatusButton.prototype._init.call(this, 'battery-missing');
+ this.parent('battery-missing', null);
+
this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
this._deviceItems = [ ];
this._readPrimaryDevice();
this._readOtherDevices();
}
-};
+});
const DeviceItem = new Lang.Class({
Name: 'DeviceItem',
const VOLUME_NOTIFY_ID = 1;
-function Indicator() {
- this._init.apply(this, arguments);
-}
-
-Indicator.prototype = {
- __proto__: PanelMenu.SystemStatusButton.prototype,
+const Indicator = new Lang.Class({
+ Name: 'VolumeIndicator',
+ Extends: PanelMenu.SystemStatusButton,
_init: function() {
- PanelMenu.SystemStatusButton.prototype._init.call(this, 'audio-volume-muted', null);
+ this.parent('audio-volume-muted', null);
this._control = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' });
this._control.connect('state-changed', Lang.bind(this, this._onControlStateChanged));
if (property == '_output' && !this._output.is_muted)
this.setIcon(this._volumeToIcon(this._output.volume));
}
-};
+});
});
-function UserMenuButton() {
- this._init();
-}
-
-UserMenuButton.prototype = {
- __proto__: PanelMenu.Button.prototype,
+const UserMenuButton = new Lang.Class({
+ Name: 'UserMenuButton',
+ Extends: PanelMenu.Button,
_init: function() {
- PanelMenu.Button.prototype._init.call(this, 0.0);
+ this.parent(0.0);
+
let box = new St.BoxLayout({ name: 'panelUserMenu' });
this.actor.add_actor(box);
this._session.ShutdownRemote();
}
}
-};
+});